package com.newcoder.huawei;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Rrshisidian {
    public static void main(String[] args) throws IOException {
        BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
        String s;
        boolean process;
        while ((s = bf.readLine()) != null) {
            int index = -1;
            process = false;
            Float[] ss = new Float[4];
            char[] cs = (s + ' ').toCharArray();
            s = null;
            int start = 0;
            for (int i = 0; i < cs.length; i++) {
                if (cs[i] == ' ') {
                    char[] c = new char[i - start];
                    System.arraycopy(cs, start, c, 0, i - start);
                    start = i + 1;
                    index++;
                    Float extracted = extracted(new String(c));
                    if (extracted == -1) {
                        process = true;
                        break;
                    } else {
                        ss[index] = extracted;
                    }
                }
            }
            if (process) {
                System.out.println("ERROR");
            } else {
                extracted(process, ss);
            }
        }
    }

    private static void extracted(boolean process, Float[] ss) {
        for (int i = 0; i < ss.length; i++) {
            for (int j = 0; j < ss.length; j++) {
                if (j != i) {
                    for (int k = 0; k < ss.length; k++) {
                        if (k != j && k != i) {
                            for (int l = 0; l < ss.length; l++) {
                                if (l != k && l != j && l != i) {
                                    float a, b, cc;
                                    for (int m = 0; m < 4; m++) {
                                        a = extracted(m, ss[i], ss[j]);
                                        for (int n = 0; n < 4; n++) {
                                            b = extracted(n, a, ss[k]);
                                            for (int o = 0; o < 4; o++) {
                                                cc = extracted(o, b, ss[l]);
                                                if (cc == 24 ) {
                                                    System.out.println(change(ss[i]) + extracted(m) + change(ss[j]) + extracted(n) + change(ss[k]) + extracted(o) + change(ss[l]));
                                                }
                                            }

                                        }
                                    }
                                }
                            }
                        }
                    }
                }

            }

        }
        if (!process) {
            System.out.println("NONE");
        }
    }

    private static float extracted(int t, float a, float b) {
        switch (t) {
            case 0:
                return a + b;
            case 1:
                return a - b;
            case 2:
                return a * b;
            case 3:
                return a / b;
            default:
                throw new RuntimeException();
        }
    }

    private static String extracted(int t) {
        switch (t) {
            case 0:
                return "+";
            case 1:
                return "-";
            case 2:
                return "*";
            case 3:
                return "/";
            default:
                throw new RuntimeException();
        }
    }

    private static Float extracted(String t) {
        switch (t) {
            case "joker":
            case "JOKER":
                return -1f;
            case "J":
                return 11F;
            case "Q":
                return 12F;
            case "K":
                return 13F;
            case "A":
                return 1F;
            default:
                return new Float(t);
        }
    }

    public static String change(float i) {
        switch ((int) i) {
            case 1:
                return "A";
            case 11:
                return "J";
            case 12:
                return "Q";
            case 13:
                return "K";
            default:
                return String.valueOf((int) i);
        }
    }
}
